<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function group(array, subNum) {
      let index = 0;
      let newArray = [];
      while (index < array.length) {
        newArray.push(array.slice(index, index += subNum));
      }
      return newArray;
    }
    var Array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
    `在这里插入代码片`
    var groupArray = group(Array, 6);
    console.log(groupArray) // [[1,2,3,4,5,6],[7,8,9,10,11,12]]
  </script>
</body>

</html>